<?php
$filename=$_POST['filename'];
$textfilecontents=$_POST['content'];
$dir = $_SERVER["DOCUMENT_ROOT"]."/gew/demo/LevelDesign/Save_scene/";
$fullpath = $dir.$filename;
$handle = fopen ($fullpath, "w+");
// now write
fwrite($handle, $textfilecontents);
?>